package test;

import java.io.FileOutputStream;
import java.io.OutputStream;

public class FileOutputStreamset {

	public static void main(String[] args) {
		OutputStream os=null;
		try {
			os=new FileOutputStream("resources/work.txt");
			String str="举头望明月，低头思故乡";
			os.write(str.getBytes());
			os.flush();
			System.out.println("写入成功");
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}finally {
			try {
				os.close();
			} catch (Exception e) {
				// TODO: handle exception
				e.printStackTrace();
			}
		}

	}

}
